<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">


            <ui:define name="content">
                <h:form>
                    <f:view beforePhase="#{manageDunningEmailManagedBean.initView}">
                        <p:growl id="growl" showDetail="true" />
                        <p:panel header="Dunning Email Detail" style="height:495px;">
                            <div style="margin-left: 200px;margin-right:200px;margin-top:30px;">
                                <h:outputText style="font-size:13px; font-weight: bolder;" value="Company Name: #{manageDunningEmailManagedBean.invoice.deliveryOrder.parentSalesOrder.customer.name}"/>
                                <br/>
                                <hr/>
                                <h:outputText style="margin-top:15px;" value="Email Pattern Detail"/>
                                    <p:editor value="#{manageDunningEmailManagedBean.receivedContent}" widgetVar="editor" width="600" /> 

                                    <p:commandButton style="position:relative; margin-top:15px;" value="Send Email To Customer" update="growl" action="#{manageDunningEmailManagedBean.sendDunningEmail}"/>
                                    <p:commandButton style="position:relative; margin-left:360px;" value="Back" action="#{manageDunningEmailManagedBean.back}"/>
                                    <p:ajaxStatus style="width:16px;height:16px;">  
                                        <f:facet name="start">  
                                            <h:outputText value="Sending"/>
                                            <h:graphicImage value="/images/loading.gif" />
                                        </f:facet>  
                                        <f:facet name="error">
                                            <h:outputText value="Error" />
                                        </f:facet>
                                        <f:facet name="complete">  
                                            <h:outputText value="Sent" />  
                                        </f:facet>  
                                    </p:ajaxStatus> 
                            </div>
                        </p:panel>    
                    </f:view>   
                </h:form>    
            </ui:define>


        </ui:composition>

    </body>
</html>
